<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/elecPrinter/elecPrinter.js"></script>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.css">
    <script src="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.js"></script>
    <%--<link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/skins/laydate.css">--%>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.css">
    <script src="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.js"></script>
    <style>
        .bootstrap-table .fixed-table-container .table thead th .th-inner {
            text-align: center !important;
        }
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>运营管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>打印机管理</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
    var OperationsManagement_printer_update = false;
</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <shiro:hasPermission name="OperationsManagement_printer_reload">
                        <input id="printerNameSearch" name="printerNameSearch" type="text"
                               class="form-control shortInput"
                               placeholder="请输入打印机名称">
                        <input id="printerRtuaSearch" name="printerRtuaSearch" type="text"
                               class="form-control shortInput input-distance"
                               placeholder="请输入打印机逻辑地址">
                        <select type="text" class="form-control shortInput input-distance" name="loginStatusSearch"
                                id="loginStatusSearch">
                            <option value="">网络状态</option>
                            <option value="0">在线</option>
                            <option value="1">离线</option>
                        </select>
                        <select type="text" class="form-control shortInput input-distance" name="statusSearch"
                                id="statusSearch">
                            <option value="">打印机状态</option>
                            <option value="0">正常</option>
                            <option value="1">缺纸</option>
                            <option value="2">故障</option>
                        </select>
                        <button class="btn btn-success input-distance" onclick="elecPrinter.reLoad()">查询</button>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="OperationsManagement_printer_add">
                        <button type="button" class="btn  btn-success marginLeft-auto"
                                onclick="elecPrinter.showModel('add')">
                            添加打印机
                        </button>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="OperationsManagement_printer_export">
                        <div class="pull-left search fr exportNumInput">
                            <input id="count" name="count" type="text" class="form-control"
                                   placeholder="导出数目">
                        </div>
                        <div class="pull-left search fr">
                            <button class="btn btn-success exportBtn" onclick="elecPrinter.exportElecPrinter()">导出</button>
                        </div>
                    </shiro:hasPermission>
                </div>


                <%--  增加打印机啊模态框  --%>
                <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
                     aria-labelledby="exampleModalLabel">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                        aria-hidden="true"></span></button>
                                <h4 class="modal-title" id="exampleModalLabel" data-dismiss="modal" aria-label="Close">
                                    关闭</h4>
                            </div>
                            <div class="modal-body">
                                <form id="contentForm" class="layui-form">
                                    <input type="hidden" class="form-control" id="printerId" name="printerId">
                                    <div class="form-group row">
                                        <label class="col-sm-4 col-form-label text-right">打印机名称*:</label>
                                        <div class="col-sm-8">
                                            <input class="form-control" id="printerName" name="printerName">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-sm-4 col-form-label text-right">打印机逻辑地址*:</label>
                                        <div class="col-sm-8">
                                            <input class="form-control" id="printerRtua" name="printerRtua">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-sm-4 col-form-label text-right">打印机纸张数*:</label>
                                        <div class="col-sm-8">
                                            <input class="form-control" id="paperRestCount" name="paperRestCount">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-sm-4 col-form-label text-right">打印机纸张数报警值*:</label>
                                        <div class="col-sm-8">
                                            <input class="form-control" id="warnCount" name="warnCount">
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                <button type="button" class="btn btn-success" id="addElecPrinter">确定</button>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <table id="exampleTable" data-mobile-responsive="true">
            </table>

        </div>
    </div>
</div>
<shiro:hasPermission name="OperationsManagement_printer_update">
    <script>
        OperationsManagement_printer_update = true;
    </script>
</shiro:hasPermission>
<script type="text/javascript">
    elecPrinter.init();
</script>
</body>
</html>
